{
	let login = document.querySelector('#login');
	let mask = document.querySelector('.mask');
	let top_user_info = document.querySelector('.top_user_info');
	let head_user_info = document.querySelector('.head_user_info');
	let close = document.querySelector('#close');
	let user_drop = document.querySelector('#user_drop');
	let head_link_personal = document.querySelector('.head_link_personal');
	top_user_info.addEventListener('mouseover',function(){
		user_drop.style.display = 'block';
	})
	top_user_info.addEventListener('mouseout',function(){
		user_drop.style.display = 'none';
	})
	user_drop.addEventListener('mouseover',function(){
		user_drop.style.display = 'block';
	})
	user_drop.addEventListener('mouseout',function(){
		user_drop.style.display = 'none';
	})
	login.addEventListener('click',function(){
		let username = document.querySelector('#username').value;
		let pwd = document.querySelector('#password').value;
		$.ajax({
			url: 'index.php?g=front&c=index&a=loginAction',
			type: 'GET',
			dataType: 'json',
			data: {username:username,pwd:pwd},
		})
		.done(function(data) {
			console.log(data);
			if(!data){
				alert('用户名与密码不匹配');
			}else{
				let user_img = document.querySelector('#user_img');
				let user_name = document.querySelector('#user_name');
				mask.style.display = 'none';
				head_user_info.style.display = 'none';
				top_user_info.style.display = 'block';
				head_link_personal.style.display = 'block';
				user_img.src = data['photo'];
				user_name.innerText = data['Nname'];
			}
		})
		.fail(function(error) {
			console.log(error);
		})
	})
	close.addEventListener('click',function(){
		head_user_info.style.display = 'block';
		top_user_info.style.display = 'none';
		head_link_personal.style.display = 'none';
	})
}